using UnityEngine;

public class SpikeBarrier : MonoBehaviour
{
	public float speed = 0.5f;

	private void OnTriggerEnter2D(Collider2D collision)
	{
		if (collision.gameObject.tag == "Zombie")
		{
			Zombie component = collision.gameObject.GetComponent<Zombie>();
			if ((bool)component && (bool)component.body)
			{
				component.body.speed = component.realSpeed * speed;
			}
		}
	}

	private void OnTriggerExit2D(Collider2D collision)
	{
		if (collision.gameObject.tag == "Zombie")
		{
			Zombie component = collision.gameObject.GetComponent<Zombie>();
			if ((bool)component && (bool)component.body)
			{
				component.body.speed = component.realSpeed;
			}
		}
	}
}
